package n2418;

import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.text.DecimalFormat;

public class Main {

	
	static class Node{
		String word;
		int cnt;
		Node left,right;
	}

	static int count;
	
	
	/**
	 * 递归
	 * @param root
	 * @param word
	 * @return
	 */
	static Node insert(Node root,String word)
	{
		if(root==null)
		{
			root=new Node();
			root.word=word;
		}
		if(root.word.compareTo(word)>0)
		{
			root.left=insert(root.left,word);
		}else if(root.word.compareTo(word)==0)
		{
			root.cnt++;
		}else {
			root.right= insert(root.right, word);
		}
		return root;
	}
	
	
	/**
	 * 非递归
	 * @param root
	 * @param word
	 * @return
	 */
	
	static Node insert2(Node root,String word)
	{
		if(root==null)
		{
			root=new Node();
			root.word=word;
			root.cnt=1;
		}else{
			Node p=root;
			while(p!=null)
			{
				if(p.word.compareTo(word)>0)
				{
					if(p.left==null)
					{
						p.left=new Node();
						p.left.cnt=1;
						p.left.word=word;
						break;
					}else p=p.left;
				}else if(p.word.compareTo(word)<0)
				{
					if(p.right==null)
					{
						p.right=new Node();
						p.right.cnt=1;
						p.right.word=word;
						break;
					}else p=p.right;
				}else{
					p.cnt++;
					break;
				}
			}
		}
		return root;
	}
	
	
	static DecimalFormat df=new DecimalFormat("0.0000");
	
	static void inOrder(Node root)
	{
		if(root!=null)
		{
			inOrder(root.left);
			System.out.println(root.word+" "+df.format((double)root.cnt/count*100));
			inOrder(root.right);
		}
	}
	
	/**
	 * @param args
	 */
	public static void main(String[] args)throws Exception {

		BufferedReader bf=new BufferedReader(new InputStreamReader(System.in));
		String line=null;
		Node root=null;
		while((line=bf.readLine())!=null)
		{
			if(line.equals(""))break;
			count++;
			if(root==null)root=insert2(null, line);
			else insert2(root, line);
		}
		inOrder(root);
	}

}
